package com.book.controller;

import com.book.service.TbTypeService;
import com.book.vo.R;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.io.Serializable;
import java.util.List;

/**
 * (TbType)表控制层
 *
 * @author makejava
 * @since 2024-11-07 21:07:32
 */
@RestController
@RequestMapping("api/tbType")
@Tag(name = "图书类型模块")
public class TbTypeController {
    /**
     * 服务对象
     */
    @Resource
    private TbTypeService service;


    @Operation(summary = "查询类型")
    @GetMapping("/type")
    public R type() {
        return service.findAll();
    }

    @Operation(summary = "根据类型查询图书")
    @GetMapping("/findBookType")
    public R findName(Integer typeId) {
        return service.findType(typeId);
    }

}

